Computer systems generally store files on storage devices such as disk drives, where the files are managed by a file system. A file system is a means to organize data expected to be retained after a program terminates by providing procedures to store, retrieve and update data as well as manage the available space on the device(s) which contain it. A file system organizes data in an efficient manner and is tuned to the specific characteristics of the device. A tight coupling usually exists between the operating system and the file system. Some file systems provide mechanisms to control access to the data and metadata. Ensuring reliability is a major responsibility of a file system. Some file systems allow multiple programs to update the same file at nearly the same time. A file system typically includes many directories organized in a hierarchy. For example, the file system may have a root directory, the root directory may have sub-directories, and the sub-directories of the root directory may in turn have sub-directories, etc. Each file in the file system may be specified by a pathname that indicates the hierarchical sequence of directories that lead to the file.
For each file, the file system stores a set of data blocks for the file, as well as metadata for accessing and managing the file. Each directory in the file system may include a table of directory entries that maps the names of the files and sub-directories in that directory to their corresponding modes (or other file metadata structures). In some file systems, a directory is implemented as a special type of file that simply lists the directory entries. For each file in the directory, the directory entry for the file simply maps the name of the file to the mode number of the file's mode. A software application may access a file if it knows the pathname of the file. For example, the sequence of directories leading to the file may be traversed until the file's directory is reached.
Before a file system can be utilized, the file system has to be mounted by the operating system via a mount point. A mount point is a physical location in the partition used as a root file system. Many different types of storage exist. Before any of them can be used for storage, the means by which information is read and written must be organized and knowledge of this must be available to the operating system via a file system. Each different file system provides the host operating system with metadata so that it knows how to read and write data. When the medium is mounted, this metadata is read by the operating system so that it can use the storage.
Today, an operating system may support multiple different file systems. The multiple file systems can be union mounted via a union mount point such that all files and directories can be represented in a unified view. A union mount is a file system mount in a computer that allows all the different mounts to overlay one another. A regular mount allows each to exist in its own realm. With a union mount, all the files from each mount are accessible. At the same time, some files may be masked if they have the same name as files from the top-most mount, because the top mount takes priority. When a file system mount is performed, each mount is positioned in a different place in the computer's memory, so none of the mounts interferes with another. With a union mount, each of the mounts is overlaid on top of one another so, while the mounts exist in different areas of the memory, they are organized in a fashion that enables users to access all of them.
FIG. 1 is a block diagram illustrating a typical union-mounted file system. Referring to FIG. 1, in this example, file systems 101 and 102 are union mounted via union mount 103. When a user initiates a search for a file object, in this example, “ . . . /X/Y/Z/Bar,” the search component of an operating system performs a search in file system 101 via path 106, starting from root 104. Note that in this example, root 104 is also a mount point of file system 101. When the search fails to find file object “Bar,” the search logic finds file system 102 via path 107, where file system 102 is mounted via mount point 105. The search logic then searches at the root level of file system 102 via path 108 for file object “Bar.” The union mount of a traditional file system typically only maintains links to root directories of all the file systems that have been union mounted. As a result, the subdirectories of a union mounted file system other than the primary file system will not be searched. In this example, the search logic never finds file object “Bar” even though file object “Bar” is stored in the same directory of . . . /X/Y/Z/Bar under file system 102.